package com.tang.model.jdk;

import java.util.Observable;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/9/6 20:39
 * @Desc
 * @Remarks
 */
public class ZhihuStandard extends Observable {

    private static final String name = "知乎";

    private static ZhihuStandard zhihu = new ZhihuStandard();

    private ZhihuStandard() {
    }

    public static ZhihuStandard getInstance() {
        return zhihu;
    }

    public String getName() {
        return name;
    }

    public void publishQuestion(Question question) {
        System.out.println("收到新的问题，准备转发给所有的监听者");
        setChanged();
        notifyObservers(question);
    }


}
